package com.example.reference_book.controller;
import com.example.reference_book.entity.Book;
import com.example.reference_book.service.BookService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("GetBookScore")
public class GetBookScore {

    @Resource
    private BookRefScore bookRefScore;

    @Resource
    private BookScoreFactory factory;

    @GetMapping("/{userid}/{type}")
    public Map<Integer, List<Book>> temp(@PathVariable("userid") Integer userid,@PathVariable("type") Integer type){
        this.bookRefScore = this.factory.getScore(type);
        if(this.bookRefScore==null){
            System.out.println("空空");
        }else
            System.out.println("不是空空");
        return this.bookRefScore.refscore(userid);
    }

}
